"""
单例模式：工具类
"""


class SingleInstance(object):
    pass


singleInstance: SingleInstance = SingleInstance()


class DataBaseClass:
    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, "_instance"):
            cls._instance = super().__new__(cls, *args, **kwargs)
        return cls._instance


obj1 = DataBaseClass()
print(id(obj1))
obj2 = DataBaseClass()
print(id(obj2))
obj3 = DataBaseClass()
print(id(obj3))
